package com.example.system.controller;

import com.example.system.common.Result;
import com.example.system.service.impl.PathKeyServiceImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("/api")
@MapperScan("com.*.mapper")
public class APIController {
    @Autowired
    private PathKeyServiceImpl pathKeyService;

    @GetMapping("/getRandomPathKey")
    public Result getRandomPathKey(){
        return Result.success(pathKeyService.getRandomPathKey());
    }
}
